Switch shutdown and sysrq to xstransact.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 13 Sep 2005 20:54:41 +0000 (20:54 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 13 Sep 2005 20:54:41 +0000 (20:54 +0000)
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
tools/python/xen/xend/XendDomainInfo.py

index 85f6abcdd89fb6e0cd97165008563083df815710..8ac581241d8f26f3db85c313dd97184c75cdc8f4 100644 (file)
@@ -1055,21 +1055,15 @@ class XendDomainInfo:
     def shutdown(self, reason):
         if not reason in shutdown_reasons.values():
             raise XendError('invalid reason:' + reason)
-        db = self.db.addChild("/control");
-        db['shutdown'] = reason;
-        db.saveDB(save=True);
+        xstransact.Write(self.path, "control/shutdown", reason)
         if not reason in ['suspend']:
             self.shutdown_pending = {'start':time.time(), 'reason':reason}
 
     def clear_shutdown(self):
-        db = self.db.addChild("/control")
-        db['shutdown'] = ""
-        db.saveDB(save=True)
+        xstransact.Remove(self.path, "control/shutdown")
 
     def send_sysrq(self, key=0):
-        db = self.db.addChild("/control");
-        db['sysrq'] = '%c' % key;
-        db.saveDB(save=True);        
+        xstransact.Write(self.path, "control/sysrq", '%c' % key)
 
     def shutdown_time_left(self, timeout):
         if not self.shutdown_pending: